import {ResDto} from "../types/common";
import instance from "../axios.service";
import {BaseUrl} from "../common/constants";

export default {
    getRoleMenuAuth: (roleCode: string): Promise<ResDto> => instance.get(`${BaseUrl}/v1/roleMenu/info/${roleCode}`),
    setRoleMenuAuth: (roleCode: string, menuCodeList: any[]): Promise<ResDto> => instance.post(`${BaseUrl}/v1/roleMenu/add?roleCode=${roleCode}`, menuCodeList),
    getUserRoleAuth: (userName: string): Promise<ResDto> => instance.get(`${BaseUrl}/v1/userRole/info/${userName}`),
    setUserRoleAuth: (userName: string, roleCodeList: any[]): Promise<ResDto> => instance.post(`${BaseUrl}/v1/userRole/add?userName=${userName}`, roleCodeList),

}
